<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>商品列表</title>
</head>
<body>
<h1>商品列表</h1>
<form action="/products/search" method="get">
    <input type="text" name="keyword" placeholder="搜索商品">
    <button type="submit">搜索</button>
</form>
<table border="1">
    <tr>
        <th>名称</th>
        <th>描述</th>
        <th>价格</th>
        <th>库存</th>
        <th>操作</th>
    </tr>
    <tr th:each="product : ${products}">
        <td th:text="${product.name}"></td>
        <td th:text="${product.description}"></td>
        <td th:text="${product.price}"></td>
        <td th:text="${product.stock}"></td>
        <td>
            <a th:href="@{'/products/edit/' + ${product.id}}">编辑</a>
            <a th:href="@{'/products/delete/' + ${product.id}}">删除</a>
        </td>
    </tr>
</table>
<a href="/products/add">添加新商品</a>
</body>
</html>
